package com.minotauro.bean.property;

import com.sun.source.tree.AnnotationTree;
import com.sun.source.util.TreePathScanner;
import com.sun.source.util.Trees;

public class AnnotationTreeVisitor extends TreePathScanner<Object, Trees> {

  private boolean isCledaBean;

  // --------------------------------------------------------------------------------

  public boolean getIsCledaBean() {
    return isCledaBean;
  }

  // --------------------------------------------------------------------------------

  public AnnotationTreeVisitor() {
    // Empty
  }

  // --------------------------------------------------------------------------------

  @Override
  public Object visitAnnotation(AnnotationTree tree, Trees trees) {
    if (tree.getAnnotationType().toString().equals("GeneratePropertyDescriptor")) {
      isCledaBean = true;
    }
    return super.visitAnnotation(tree, trees);
  }
}